Skip to content

feat(kubernetes): gate zone-aware routing on ingress-controller zone balance - #4377

Merged
MustafaSaber merged 8 commits into
masterfrom
opt-out-zone-aware
Nov 2, 2026
Merged

MustafaSaber merged 8 commits into
masterfrom
opt-out-zone-aware

Conversation

@MustafaSaber

@MustafaSaber MustafaSaber commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Serve zone-filtered routes only when skipper-ingress itself is balanced
across zones; otherwise fall back to the global table. Adds configurable
namespace/name/max-skew, closes a data race and a silent-misconfiguration
gap, and adds unit/config/end-to-end test coverage.

088ef1d show no regression in benchmarks against master

@MustafaSaber MustafaSaber added the architectural all changes in the hot path, big changes in the control plane, control flow changes in filters label Oct 23, 2026
Comment thread dataclients/kubernetes/kube.go Resolved
Comment thread config/config.go Resolved
@zalando-robot

Copy link
Copy Markdown

Docker image "registry-write.opensource.zalan.do/teapot/skipper:4537e8c34c46b2c4fcab78a4d70e474400ab4515" is not based on an approved base image. Any production deployment relying on this image will be blocked.

To create a compliant Docker image of your application, you must reference an allowed Docker image as its base image in your Dockerfile. This base image must come from the Zalando Container Registry namespace library and use a recommended version as listed in the documentation.

@greeshma1196

Copy link
Copy Markdown
Member

👍🏽

Comment thread dataclients/kubernetes/clusterclient.go Outdated
ingressValidator *definitions.IngressV1Validator
balancedAcrossZones atomic.Bool
ingressControllerNamespace string
ingressControllerName string

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not a label selector?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we need namespace and name for the ResourceID anyway that we use to get endpointSlices

@szuecs szuecs Oct 27, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then we have not canary possible to include, what I don't like.
Please think about the problem of multiple deployments like we have in our setup.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah nice catch, totally forgot about that. Updated now

Comment thread dataclients/kubernetes/clusterclient.go Resolved
Comment thread routesrv/polling.go Resolved
Comment thread routesrv/eskipbytes.go Resolved
@MustafaSaber
MustafaSaber force-pushed the opt-out-zone-aware branch 2 times, most recently from 1fa4be9 to 6888da1 Compare October 26, 2026 20:09
… distributed across zone in this current poll

Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
… zone-aware gate

Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
Benchmark results compared against origin/master

```
goos: linux
goarch: amd64
pkg: github.com/zalando/skipper/routesrv
cpu: Intel(R) Core(TM) Ultra 7 265U
                              │    before    │               after                │
                              │    sec/op    │    sec/op     vs base              │
FormatAndSet-14                 268.7m ± ∞ ¹   277.8m ± ∞ ¹       ~ (p=0.548 n=5)
FormatAndSetNoChange-14         60.45m ± ∞ ¹   63.66m ± ∞ ¹       ~ (p=0.151 n=5)
FormatAndSetOneZoneChanged-14   232.6m ± ∞ ¹   227.9m ± ∞ ¹       ~ (p=0.222 n=5)
geomean                         155.8m         159.1m        +2.16%
¹ need >= 6 samples for confidence interval at level 0.95

                │   before    │             after              │
                │ retained_MB │ retained_MB  vs base           │
FormatAndSet-14   1.986 ± ∞ ¹   1.986 ± ∞ ¹  ~ (p=1.000 n=5) ²
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal

                              │    before     │                after                │
                              │     B/op      │     B/op       vs base              │
FormatAndSet-14                 227.8Mi ± ∞ ¹   227.8Mi ± ∞ ¹  +0.00% (p=0.008 n=5)
FormatAndSetNoChange-14         86.34Mi ± ∞ ¹   86.35Mi ± ∞ ¹       ~ (p=0.421 n=5)
FormatAndSetOneZoneChanged-14   229.7Mi ± ∞ ¹   217.8Mi ± ∞ ¹  -5.15% (p=0.008 n=5)
geomean                         165.3Mi         162.4Mi        -1.75%
¹ need >= 6 samples for confidence interval at level 0.95

                              │    before    │               after                │
                              │  allocs/op   │  allocs/op    vs base              │
FormatAndSet-14                 2.380M ± ∞ ¹   2.380M ± ∞ ¹  +0.00% (p=0.008 n=5)
FormatAndSetNoChange-14         700.0k ± ∞ ¹   700.0k ± ∞ ¹       ~ (p=1.000 n=5)
FormatAndSetOneZoneChanged-14   2.483M ± ∞ ¹   2.268M ± ∞ ¹  -8.65% (p=0.008 n=5)
geomean                         1.605M         1.558M        -2.97%
¹ need >= 6 samples for confidence interval at level 0.95
```

Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
@zalando-robot

Copy link
Copy Markdown

Docker image "registry-write.opensource.zalan.do/teapot/skipper:5d8f4c937c408106579470772154973481211225" is not based on an approved base image. Any production deployment relying on this image will be blocked.

To create a compliant Docker image of your application, you must reference an allowed Docker image as its base image in your Dockerfile. This base image must come from the Zalando Container Registry namespace library and use a recommended version as listed in the documentation.

…ination to also catch canary

Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
@zalando-robot

Copy link
Copy Markdown

Docker image "registry-write.opensource.zalan.do/teapot/skipper:3de4f887b0d42adce00bb4307645af6fe3f1e772" is not based on an approved base image. Any production deployment relying on this image will be blocked.

To create a compliant Docker image of your application, you must reference an allowed Docker image as its base image in your Dockerfile. This base image must come from the Zalando Container Registry namespace library and use a recommended version as listed in the documentation.

@greeshma1196

Copy link
Copy Markdown
Member

👍🏽

return false
}

if len(zoneCounts) < minZones {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I maxSkew is >=1 and you have 1,1,0 pods then it means we aren't balanced.
It's fine just needs documentation

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, we assume here is that we don't have at least 1 pod in a zone we are not balanced

@MustafaSaber
MustafaSaber merged commit 83c728c into master Nov 2, 2026
33 of 34 checks passed
@MustafaSaber
MustafaSaber deleted the opt-out-zone-aware branch November 2, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

architectural all changes in the hot path, big changes in the control plane, control flow changes in filters

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants